from mission_7_30_1.Base.Base import Base
from selenium.webdriver.common.by import By
import time
class Page1(Base):
    login_loc=(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    def login(self):
        self.click(self.login_loc)

    dy1_loc=(By.XPATH,'/html/body/div[4]/div/div[1]/div[1]/span[1]')
    def dy1(self):
        return self.text(self.dy1_loc)

    username_loc=(By.NAME,'username')
    password_loc=(By.NAME,'password')
    def username(self,username,password):
        self.send_keys(self.username_loc,username)
        self.send_keys(self.password_loc,password)
    login1_loc=(By.XPATH,'//*[@id="theForm"]/div[5]/a')
    def login1(self):
        self.click(self.login1_loc)

    dy2_loc=(By.XPATH,'/html/body/div[5]/div[2]/div[1]/div[2]/div[2]/ul/li[4]/span')
    def dy2(self):
        return self.text(self.dy2_loc).replace('¥ ','')
    dy3_loc=(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    def dy3(self):
        return self.text(self.dy3_loc)

    def A3mall_login(self):
        self.open_url('http://10.59.9.12:7001/')
        self.login()
        self.dy1()
        print(self.dy1())
        self.username('13811033962','123456')
        time.sleep(5)
        self.login1()
        time.sleep(5)
        self.dy2()
        print(self.dy2())
        self.dy3()
        print(self.dy3())